package com.benchmark.springboot.controller;

import com.benchmark.springboot.model.XssObject;
import com.power.common.model.CommonResult;
import org.springframework.web.bind.annotation.*;

/**
 * Xss处理
 * @author yu 2020/4/23.
 */
@RestController
@RequestMapping("xss")
public class XssController {

    /**
     * xss处理json
     * @param xssObject
     * @return
     */
    @PostMapping("json")
    public CommonResult<XssObject> jsonInput(@RequestBody XssObject xssObject){
        return CommonResult.ok().setResult(xssObject);
    }

    /**
     * 普通表单xss
     * @param message 消息体|<script>alert(\"hello\");</script>
     * @return
     */
    @GetMapping("normal")
    public CommonResult<String> json(String message){
        return CommonResult.ok().setResult(message);
    }
}
